'use strict'

module.exports = (app) => {
  const { STRING, INTEGER } = app.Sequelize

  const TestTestforeign = app.model.define(
    'test_testforeign',
    {
      id: {
        type: INTEGER,
        primaryKey: true,
        autoIncrement: true
      },
      testforeign_id: {
        type: STRING,
        primaryKey: true,
        allowNull: false,
        unique: true
      },
      testforeign_name: {
        type: STRING,
      }
    },
    {
      // timestamps: false, // 不使用createAt和updateAt字段
      freezeTableName: true, // 禁止自动复数化表名
      createdAt: 'created_at',
      updatedAt: 'updated_at'
    }
  )

  return TestTestforeign
}
